<template>
  <div>
    <HeadView />
    <div class="content address_box register">
      <div class="r_con">
        <CardView v-if="title" :title="title"  />

        <div class="de_right">
          <TableView v-if="address" :address="address" />
          <TableView v-if="!address"/>
        </div>
      </div>
    </div>
  </div>
  
</template>

<script>
import CardView from '@/components/CardView.vue'
import TableView from '@/components/TableView.vue'
import HeadView from '@/components/HeadView.vue'
export default {
  data(){
    return {
      star:null,
      type:'details',
      title:'',
      address:null
    }
  },
  mounted(){
    
    this.address = localStorage.getItem('address') || null
    console.log('this.address add')
    console.log(this.address)
    
    this.title = this.$route.query.title || ''
    this.star = this.$route.query.star || false
  },
  methods:{
    onTab(val){
      this.type = val
    }
  },
  components: {
    CardView,
    TableView,
    HeadView
  },
  watch:{
    '$store.state.address':function(val){
      console.log('val')
      console.log(val)
      this.address = val || null
    }
  }
  
}
</script>

<style lang="less" scoped>
  .address_box{
    background: none;
    box-shadow:none;
    margin-top:60px
  }
  .address_box .de_right{
    padding: 20px;
    border-radius: 8px;
    box-shadow: 1px 1px 6px #ddd;
  }
</style>
